package com.example.administrator.uis.view

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

/**
 * Created by Administrator on 2017/11/10 0010.
 */
class PracticeDrawPaintView : View {
    constructor(context: Context?) : super(context) {
    }

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {

    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        var paint = Paint()
        paint.isAntiAlias=true
        paint.strokeWidth = 120f//tmd 点不管用啊
        paint.color=Color.RED
//        paint.strokeCap=Paint.Cap.SQUARE
        canvas?.drawPoint(30f, 30f, paint)
        var points= floatArrayOf(0f, 0f, 50f, 50f, 50f, 100f, 100f, 50f, 100f, 100f, 150f, 50f, 150f, 100f)
        canvas?.drawPoints(points,paint)

    }

}